package com.zoe.app.gloabledata;

import cn.hutool.core.map.MapUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ModelAttribute;

import java.util.Map;

/**
 * @author Zoe.Zhang
 * @date 2021/10/07
 * @description 全局数据绑定
 */
@ControllerAdvice
public class GlobalData {
    @ModelAttribute("info")
    public Map<String, String> myData() {
        Map<String, String> stringStringHashMap = MapUtil.newHashMap();
        stringStringHashMap.put("username", "zoe");
        stringStringHashMap.put("address", "北京");
        return stringStringHashMap;
    }
}

